class menu
{
 int[][] galaxyCoords = {
                         {406,400},
                         {753,346},
                         {1097,261}
                        };
 boolean mouseDown = false;
 boolean mouseClick = false;
 
 void drawMenu()
 {
   image(img.menuBackground, 0, 0);
   if(getDistToMouse(galaxyCoords[0]) < 100)
   {
     writeLargeText("Easy", 400,200);
     if(mouseClick)
     {
       difficulty = 0;
       gameState = 2;
       return;
     }
   }
     
   if(getDistToMouse(galaxyCoords[1]) < 100)
   {
     writeLargeText("Medium", 720, 150);
     if(mouseClick)
     {
       difficulty = 0;
       gameState = 2;
       return;
     }
   }
     
   if(getDistToMouse(galaxyCoords[2]) < 100)
   {  
     writeLargeText("Hard",1100,75);
     if(mouseClick)
     {
       difficulty = 0;
       gameState = 2;
       return;
     }
   }
   
   //--------search for mouse clicks
   mouseClick = false;
   if(isMouseDown && !mouseDown)
    {
      mouseDown = true;
    }
    if(mouseDown && !isMouseDown)
    {
     mouseDown = false;
     mouseClick = true;
    }
 }
 
 void writeLargeText(String toWrite, int x, int y)
 {
   PFont font = menuFont;
   textFont(font);
   text(toWrite, x, y);
 }
 
 float getDistToMouse(int[] coords)
 {
   return sqrt(pow((coords[0] - mouseX),2) + pow((coords[1] - mouseY),2));
 }
}


